#pragma once

#include <unordered_map>
#include "../share/user_define.h"
#include "../../3rd/libjson/json.h"



struct BuyReset
{
	uint32_t mId;
	std::vector<uint32_t> mPowerBuy;
	std::vector<uint32_t> mResetStage;
	uint32_t mResetArenaCD;
	std::vector<uint32_t> mBuyVitality;
	std::vector<uint32_t> mBuySkill;

	BuyReset()
	{
		Clear();
	}

	void Clear(void)
	{
		mId = 0;
	}
};

class BuyResetCacheData
{
public:

	static void CreateInstance(void);
	static BuyResetCacheData* GetInstance(void);

	~BuyResetCacheData(void);

public:

	bool Initialization(void);

	bool Reload(void);

	BuyReset* GetData(uint32_t id);

	bool GetDataJsonString(uint32_t id, Json::Value& _jm);

	uint32_t GetDataCount(void);

private:
	BuyResetCacheData(void);

	void Clear(void);

	void AddData(uint32_t id, Json::Value& jm);


private:

	static BuyResetCacheData* mInstance;

	std::unordered_map<uint32_t, BuyReset*> m_mapCacheData;
	uint32_t m_maxCount;

};